package com.ruoyi.vocationalmajor.mapper;

import com.ruoyi.vocationalmajor.domain.ExamVocationalMajor;
import com.ruoyi.volunteermajor.domain.ExamVolunteerMajor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ExamVocationalMajorMapper {

    @Select("SELECT * FROM tb_vocational_major WHERE id = #{id}")
    ExamVocationalMajor selectVocationalMajorById(Long id);

    @Select("SELECT * FROM tb_vocational_major WHERE college_id = #{collegeId}")
    List<ExamVocationalMajor> selectVocationalMajorListByCollegeId(Long collegeId);

    @Select("SELECT * FROM tb_vocational_major")
    List<ExamVocationalMajor> selectVocationalMajorList();

    @Insert("INSERT INTO tb_vocational_major (college_id, name) VALUES (#{collegeId}, #{name})")
    int insertVocationalMajor(ExamVocationalMajor vocationalMajor);

    @Update("UPDATE tb_vocational_major SET college_id = #{collegeId}, name = #{name} WHERE id = #{id}")
    int updateVocationalMajor(ExamVocationalMajor vocationalMajor);

    @Delete("DELETE FROM tb_vocational_major WHERE id = #{id}")
    int deleteVocationalMajorById(Long id);
}
